﻿using Management.Systeam.Domaina;
using Management.Systeam.ErrorCode;
using Management.Systeam.Write.Api.Application.Command.Useres;
using MediatR;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace Management.Systeam.Write.Api.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class UserValuesController : ControllerBase
    {
        IMediator mediator;

        public UserValuesController(IMediator mediator)
        {
            this.mediator = mediator;
        }
        [HttpPost]
        public async Task<ApiResult<int>> AddUser(AddUserCommand AddUserCommands)
        {
            try
            {
                return await mediator.Send(AddUserCommands);
            }
            catch (Exception)
            {

                throw;
            }
        }


    }
}
